﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class 消费者_注册_登录_注册 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string name = TextBox1.Text.Trim();
        string ps = TextBox2.Text.Trim();
        Tourist_users tmp = new Tourist_users();
        tmp.name = name;
        tmp.ps = ps;
        int result = tmp.Toutist(tmp);
        if(result>0)
        {
            Response.Write("<script>alert(\"恭喜你，注册成功！！\")</script>");
        }
        else
        {
            Response.Write("<script>alert(\"恭喜你，注册失败！！\")</script>");
        }
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        string name= TextBox1.Text.Trim();
        Tourist_users tmp = new Tourist_users();
        tmp.name = name;
        int result = tmp.Tourist_users1(tmp);
        if(result>0)
        {
            lblMsg.Visible = true;
            lblMsg.Text = "这个姓名已经存在！";
        }
        else
        {
            lblMsg.Visible = true;
            lblMsg.Text = "这个姓名可用！";
        }

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/消费者/注册 登录/Default.aspx");
    }
}